import { InjectionKey } from 'vue'
import { Rules, Values } from 'async-validator'

export interface FormData {
  model: Record<string, unknown>
  rules?: Rules
}

export interface FormItem {
  validate: () => Promise<Values>
}

export type FormType = {
  validate: (callback: (valid: boolean) => void) => void
}
export interface FormData {
  model: Record<string, unknown>
  rules?: Rules
}
export const key: InjectionKey<FormData> = Symbol('form-data')
